#include "PngModule.h"



PngModule::PngModule()
{
}


PngModule::~PngModule()
{
}



byte* PngModule::getFileIdentity() {
	return this->fileIdentity;
}


void PngModule::setLocation(DWORD location) {
	this->location = location;
}

DWORD PngModule::getLocation() {
	return this->location;
}

bool PngModule::parePngHead(byte* buffer,int length) {
	
	if (length < 24) {
		return false;
	}

	int height = buffer[16] * 256 * 256 * 256 + buffer[17] * 256 * 256 + buffer[18] * 256 + buffer[19];
	int width = buffer[20] * 256 * 256 * 256 + buffer[21] * 256 * 256 + buffer[22] * 256 + buffer[23];
	this->fileSize = height * width;

	return true;
}

int PngModule::getFileSize() {
	return this->fileSize;
}
